home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Pascal Super Library
/
Pascal Super Library (CW International)(1997).bin
/
BBS_UTL
/
DDPLUS71
/
MACROKEY.ZIP
/
MACROKEY.PAS
< prev
Wrap
Pascal/Delphi Source File
|
1995-03-14
|
1KB
|
64 lines
unit MacroKey;
interface
uses DOS, CRT, DDPlus, DDScott;
procedure record_macro(var s: string);
procedure display_macro(s: string);
implementation
procedure record_macro(var s: string);
var
ch: char;
ln: byte;
begin;
ln:=1;
s:='';
set_foreground(lightblue);
swrite(va(ln)+'> ');
set_foreground(white);
repeat;
sread_char(ch);
if ch<>^n then begin;
swrite(ch);
if ch=#13 then begin;
ln:=ln+1;
set_foreground(lightblue);
swrite(#10+va(ln)+'> ');
set_foreground(white);
end;
s:=s+ch;
end;
until (ch=^N) or (length(s)=80);
set_foreground(default_fore);
if length(s)=80 then swriteln('Maximum length reached.');
end;
procedure display_macro(s: string);
var
ln: byte;
a: integer;
begin;
ln:=1;
if s='' then swriteln('No macro recorded.') else begin;
set_Foreground(lightblue);
swrite(va(ln)+'> ');
set_foreground(white);
for a:=1 to length(s) do begin;
swrite(s[a]);
if s[a]=#13 then begin;
ln:=ln+1;
swrite(#10);
set_foreground(lightblue);
swrite(va(ln)+'> ');
set_foreground(white);
end;
end;
end;
swriteln('');
swriteln('');
end;
End.